package main

import "fmt"

func maxProfit(prices []int) int {
	if len(prices) == 0 {
		return 0
	}
	div := 0
	for i := 0; i < len(prices); i++ {
		div1 := 0
		for j := i + 1; j < len(prices); j++ {

			if prices[j]-prices[i] > div1 {
				div1 += prices[j] - prices[i]
				fmt.Println(maxProfit(prices[j+1:]))
			}
		}
		div += div1
	}
	return div
}
func main() {
	data := [...]int{7, 1, 5, 3, 6, 4}
	fmt.Println(maxProfit(data[:]))
}
